﻿<%@ Page Title="" Language="C#" MasterPageFile="~/RosarioFinanzas.Master" AutoEventWireup="true"
    CodeBehind="Noticias.aspx.cs" Inherits="RosarioFinanzas.Noticias" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>ROSARIO FINANZAS - Noticias</title>
    <script type="text/javascript">
        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-28485653-1']);
        _gaq.push(['_trackPageview']);

        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            GetObjetos('Noticias.aspx');
            strfecha();
            BorrarEstiloMenuPrincipal();
            SeleccionEstilo("NOTICIAS");

        $("#btnNewsletter").click(

                function (e) {

                    e.preventDefault();   // Evita que se recargue la web luego de terminado el método

                    if ($("#emailNewsletter").val() != "") {

                        if (isValidEmailAddress($("#emailNewsletter").val())) {

                            $.ajax({
                                type: "POST",
                                url: "Service1.asmx/InscripcionNewsletter",
                                data: "{email:'" + $("#emailNewsletter").val() + "'}",
                                contentType: "application/json; charset=utf-8",
                                async: false,
                                dataType: "json",
                                success: function (msg) {

                                    alert("Su inscripción ha sido recibida correctamente");
                                    location.reload();

                                },
                                error: function (xhr, ajaxOptions, thrownError) {
                                    alert("Hubo un error al enviar su solicitud. Por favor intentelo nuevamente o contáctenos a través de las Redes Sociales");

                                }
                            });

                        } else {
                            alert("El formato del email es inválido");
                        }

                    } else {
                        alert("El e-mail es obligatorio");
                    }
                });
        });

        function isValidEmailAddress(emailAddress) {
            var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
            return pattern.test(emailAddress);
        };
        
    </script>
    <link rel="stylesheet" type="text/css" href="CSS/Noticias.css?version=3" />
    <link rel="stylesheet" type="text/css" href="CSS/jquery/jquery-ui-1.8.16.custom.css"  />

    <script src="scripts/jquery/jquery-ui-1.8.14.custom.js" type="text/javascript"></script>
    <script src="scripts/jquery/jquery.ui.core.js" type="text/javascript"></script>
    <script src="scripts/jquery/jquery.ui.datepicker.js" type="text/javascript"></script>
    <script src="scripts/jquery/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="scripts/jquery/jquery.ui.datepicker-es.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="submenu" style="height: 0px;">
        <ul id="menuIzquierda">
        </ul>
    </div>
    <div id="ColumnaDerecha">
        <div id="PublicidadDerecha">
            
        </div>
        <div id="inscripcionNewsLetter">
            <label class="titulo-Newsletter" >Inscripción al Newsletter</label>
            <table>
                <tr>
			        <td><label class="email-Newsletter" >Dejanos tu E-Mail:</label></td> 
                </tr>
                <tr>
			        <td><input type="text" id="emailNewsletter" class="input-Newsletter" name="email"/></td>
                </tr>
            </table>
            <button type="button" id="btnNewsletter" class="buttonNewsLetter">Inscribirse</button>

        </div>
         <br />   
        <iframe style="text-decoration: none; border: 0; overflow: hidden;" width="100%"
            height="370px" src="NoticiasSugeridas.aspx" frameborder="0"  scrolling="no" border="0" marginwidth='0' marginheight ='0'></iframe>
    
    </div>
    <div id="ColumnaIzquirda">
        <div id="Noticias">
            NOTICIAS</div>
        <div>
            <asp:ListView ID="ListViewArticulos" runat="server" OnPreRender="ListViewArticulos_PreRender">
                <LayoutTemplate>
                    <div id="itemPlaceholderContainer">
                        <div runat="server" id="itemPlaceholder">
                        </div>
                    </div>
                </LayoutTemplate>
                <ItemTemplate>
                    <div class="itemPlaceholder">
                       <a href="Noticia.aspx?id=<%# Eval("id")%>" style="text-decoration: none;" target="_blank"><div> <span style="float:left; width: 70%;">
                            <asp:Label ID="Titulo" runat="server" CssClass="TituloBusqueda" Text='<%# Eval("Titulo") %>' /></span>
                            <span style="float:right"><asp:Label ID="Fecha" runat="server" CssClass="Fecha" Text='<%# Eval("Fecha") %>' /></span></div>
                        <div style="clear: both;">
                            <asp:Label ID="Cuerpo" runat="server" CssClass="CuerpoBusqueda" Text='<%# Eval("Resumen") %>' />
                        </div>
                        
                        </a>
                    </div>
                </ItemTemplate>
            </asp:ListView>
        </div>
        <div class="Paginador">
            <br/>
            <asp:DataPager ID="DataPager1" runat="server" PageSize="8" PagedControlID="ListViewArticulos"
                OnPreRender="DataPager1_PreRender">
                <Fields>
                    <asp:NextPreviousPagerField ButtonType="link" ShowFirstPageButton="True" ShowNextPageButton="False"
                        FirstPageText="Primero" LastPageText="Ultimo" NextPageText="Siguiente" PreviousPageText="Anterior" /> 
                    <asp:NumericPagerField />
                    <asp:NextPreviousPagerField LastPageText="Ultimo" NextPageText="Siguiente" ShowLastPageButton="True"
                        ShowPreviousPageButton="False" />
                </Fields>
            </asp:DataPager>
            <br/>
        </div>
    </div>
    <div id="ColumnaCentro">
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div>
        <span id="Fecha"></span>
    </div>
</asp:Content>
